package yja.gzw.app.activity

import android.content.Intent
import android.util.Log
import android.widget.Toast
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import yja.gzw.app.GenerateTestUserSig
import yja.gzw.app.R
import yja.gzw.app.adapter.PinglongAdapter
import yja.gzw.app.base.BaseActivity
import yja.gzw.app.databinding.ActivityCeshiBinding
import yja.gzw.app.model.UserData
import yja.gzw.app.viewmodel.Mainviewmodel
import com.tencent.imsdk.v2.V2TIMConversation
import com.tencent.qcloud.tuicore.TUIConstants
import com.tencent.qcloud.tuicore.TUILogin
import com.tencent.qcloud.tuicore.interfaces.TUICallback
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIC2CChatActivity
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity


class CeshiActivity :BaseActivity<Mainviewmodel, ActivityCeshiBinding>(R.layout.activity_ceshi) {
    override fun initView() {

            binding.denglu.setOnClickListener {

                viewmodel.onpinglongwang(UserData.token, mapOf("forum_id" to "1"))
            }

    }

    override fun dataObservese() {

        viewmodel.onpinglong.observe(this, Observer {
            if(it.code==1){
                Log.e("评论数据",it.data.data[0].toString())

            }else{
                Toast.makeText(this,it.msg, Toast.LENGTH_SHORT).show()

            }

        })

    }
}